<?php

namespace app\models\dao;

use Yii;

/**
 * This is the model class for table "{{%task}}".
 *
 * @property integer $id
 * @property integer $user_id
 * @property integer $project_id
 * @property integer $action
 * @property integer $status
 * @property string $title
 * @property string $link_id
 * @property string $ex_link_id
 * @property string $commit_id
 * @property string $branch
 * @property integer $file_transmission_mode
 * @property string $file_list
 * @property integer $enable_rollback
 * @property integer $flag
 * @property string $created_time
 * @property string $updated_time
 */
class Task extends \app\common\PopToolActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%task}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id'], 'required'],
            [['user_id', 'project_id', 'action', 'status', 'file_transmission_mode', 'enable_rollback', 'flag'], 'integer'],
            [['file_list'], 'string'],
            [['created_time', 'updated_time'], 'safe'],
            [['title', 'commit_id', 'branch'], 'string', 'max' => 100],
            [['link_id', 'ex_link_id'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => '用户id',
            'project_id' => '项目id',
            'action' => '0全新上线，2回滚',
            'status' => '状态0：新建提交，1审核通过，2审核拒绝，3上线完成，4上线失败',
            'title' => '上线的软链号',
            'link_id' => '上线的软链号',
            'ex_link_id' => '上一次上线的软链号',
            'commit_id' => 'git commit id',
            'branch' => '选择上线的分支',
            'file_transmission_mode' => '上线文件模式: 1.全量所有文件 2.指定文件列表',
            'file_list' => '文件列表，svn上线方式可能会产生',
            'enable_rollback' => '能否回滚此版本:0no 1yes',
            'flag' => '数据状态：0、正常，1、作废',
            'created_time' => '创建时间',
            'updated_time' => '修改时间',
        ];
    }
}
